import VueRouter from 'vue-router'

//导入路由组件
import HomeContainer from './components/tabbar/home.vue'
import MemberContainer from './components/tabbar/member.vue'
import CartContainer from './components/tabbar/cart.vue'
import SearchContainer from './components/tabbar/search.vue'
import NewsList from './components/news/newsList.vue'
import NewsInfo from './components/news/newsInfo.vue'

//创建路由对象
let router = new VueRouter({
	routes:[
		{ path: '/', redirect: '/home' },
		//重定向，根目录指向
		{ path:'/home',component:HomeContainer },
		{ path:'/member',component:MemberContainer },
		{ path:'/cart',component:CartContainer },
		{ path:'/search',component:SearchContainer },
		{ path:'/home/newsList',component:NewsList },
		{ path:'/home/newsInfo/:id',component:NewsInfo }
	],
	linkActiveClass:'mui-active' //覆盖默认的路由高亮类:router-link-active
})

export default router

